﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Profile;

namespace WebSite.admin.system
{
    public partial class shop_config04 : BaseAdmin
    {
        // Fields
    
        // Methods
        private void Bind()
        {
            string sql = "select top 1 * from DB_Shopconfig ";
            DataTable table = new DataTable();
            table = SQLAccess.GreatDs(sql).Tables[0];
            this.shopcofig.Value = table.Rows[0]["shopcofig"].ToString();
            this.shopisfapai.SelectedValue = table.Rows[0]["shopisfapai"].ToString();
            this.shopisscore.SelectedValue = table.Rows[0]["shopisscore"].ToString();
            this.shopishongbao.SelectedValue = table.Rows[0]["shopishongbao"].ToString();
            this.shopisyuscore.SelectedValue = table.Rows[0]["shopisyuscore"].ToString();
            this.shopisque.SelectedValue = table.Rows[0]["shopisque"].ToString();
            this.shopisemail1.SelectedValue = table.Rows[0]["shopisemail1"].ToString();
            this.shopisemail2.SelectedValue = table.Rows[0]["shopisemail2"].ToString();
            this.shopisemail3.SelectedValue = table.Rows[0]["shopisemail3"].ToString();
            this.shopisemail4.SelectedValue = table.Rows[0]["shopisemail4"].ToString();
            this.shopisorder1.SelectedValue = table.Rows[0]["shopisorder1"].ToString();
            this.shopisorder2.SelectedValue = table.Rows[0]["shopisorder2"].ToString();
            this.shopisorder3.SelectedValue = table.Rows[0]["shopisorder3"].ToString();
            this.shopisorder4.SelectedValue = table.Rows[0]["shopisorder4"].ToString();
            this.shopisorder5.SelectedValue = table.Rows[0]["shopisorder5"].ToString();
            this.shopispro1.SelectedValue = table.Rows[0]["shopispro1"].ToString();
            this.shopispro2.SelectedValue = table.Rows[0]["shopispro2"].ToString();
            this.shopispro3.SelectedValue = table.Rows[0]["shopispro3"].ToString();
            this.shopcontent1.Text = table.Rows[0]["shopcontent1"].ToString();
            this.shopislog.SelectedValue = table.Rows[0]["shopislog"].ToString();
            this.shopsmallprice.Value = table.Rows[0]["shopsmallprice"].ToString();
            this.shopisorders.SelectedValue = table.Rows[0]["shopisorders"].ToString();
            this.shoppaiprice1.Value = table.Rows[0]["shoppaiprice1"].ToString();
            this.shoppaiprice2.Value = table.Rows[0]["shoppaiprice2"].ToString();
            this.shoppaiprice3.Value = table.Rows[0]["shoppaiprice3"].ToString();
            this.shoppaitype1.Value = table.Rows[0]["shoppaitype1"].ToString();
            this.shoppaitype2.Value = table.Rows[0]["shoppaitype2"].ToString();
            this.shoppaitype3.Value = table.Rows[0]["shoppaitype3"].ToString();
            this.shopordertime1.SelectedValue = table.Rows[0]["shopordertime1"].ToString();
            this.shopordertime2.SelectedValue = table.Rows[0]["shopordertime2"].ToString();
        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            SQLAccess.DoSql("update DB_Shopconfig set shopcofig=" + re.replace(this.shopcofig.Value) + ",shopisfapai=" + re.replace(this.shopisfapai.SelectedValue) + ",shopisscore=" + re.replace(this.shopisscore.SelectedValue) + ",shopishongbao=" + re.replace(this.shopishongbao.SelectedValue) + ",shopisyuscore=" + re.replace(this.shopisyuscore.SelectedValue) + ",shopisque=" + re.replace(this.shopisque.SelectedValue) + ",shopisemail1=" + re.replace(this.shopisemail1.SelectedValue) + ",shopisemail2=" + re.replace(this.shopisemail2.SelectedValue) + ",shopisemail3=" + re.replace(this.shopisemail3.SelectedValue) + ",shopisemail4=" + re.replace(this.shopisemail4.SelectedValue) + ",shopisorder1=" + re.replace(this.shopisorder1.SelectedValue) + ",shopisorder2=" + re.replace(this.shopisorder2.SelectedValue) + ",shopisorder3=" + re.replace(this.shopisorder3.SelectedValue) + ",shopisorder4=" + re.replace(this.shopisorder4.SelectedValue) + ",shopisorder5=" + re.replace(this.shopisorder5.SelectedValue) + ",shopispro1=" + re.replace(this.shopispro1.SelectedValue) + ",shopispro2=" + re.replace(this.shopispro2.SelectedValue) + ",shopispro3=" + re.replace(this.shopispro3.SelectedValue) + ",shopcontent1='" + re.replace(this.shopcontent1.Text) + "',shopislog=" + re.replace(this.shopislog.SelectedValue) + ",shopsmallprice=" + re.replace(this.shopsmallprice.Value) + ",shopisorders=" + re.replace(this.shopisorders.SelectedValue) + ",shoppaitype1='" + re.replace(this.shoppaitype1.Value) + "',shoppaitype2='" + re.replace(this.shoppaitype2.Value) + "',shoppaitype3='" + re.replace(this.shoppaitype3.Value) + "',shoppaiprice1=" + re.replace(this.shoppaiprice1.Value) + ",shoppaiprice2=" + re.replace(this.shoppaiprice2.Value) + ",shoppaiprice3=" + re.replace(this.shoppaiprice3.Value) + ",shopordertime1=" + re.replace(this.shopordertime1.SelectedValue) + ",shopordertime2=" + re.replace(this.shopordertime2.SelectedValue) );
            base.Response.Write("<script language='javascript'>window.location.href='shop_config04.aspx';</script>");
            base.Response.End();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Session["Adminlogin"] == null)
            {
                base.Response.Write("<script language=javascript>window.top.location.href='../login.aspx';</script>");
                base.Response.End();
            }
            if (!base.IsPostBack)
            {
                this.Bind();
            }
        }

       

    }
}